/*
 *  common.h
 *
 *  Created on: 2010-5-9
 *      Author: liuyond
 */

#ifndef COMMON_H
#define COMMON_H

typedef unsigned char  byte;
typedef unsigned short word;
typedef unsigned long  dword;


// define some macro for casting
#define BYTE(address) \
	((unsigned char)(address))
#define WORD(address) \
	((unsigned short)(address))
#define DWORD(address) \
	((unsigned long)(address))

#define BYTEP(address) \
	((unsigned char *)(address))
#define WORDP(address) \
	((unsigned short *)(address))
#define DWORDP(address) \
	((unsigned long *)(address))

// define some macro for getting data
#define fetch_byte(address) \
	(*(unsigned char *)(address))
#define fetch_word(address) \
	(*(unsigned short *)(address))
#define fetch_dword(address) \
	(*(unsigned long *)(address))

#endif /* COMMON_H */
